import numpy as np
import  pylab as pl
from sklearn import svm

#seed 值不变的话 每次获取的随机值一样
np.random.seed(0)

X=np.r_[np.random.randn(20,2)-[2,2],np.random.randn(20,2)+[2,2]]
Y=[0]*20+[1]*20

print(X)
print(Y)

clf=svm.SVC(kernel='linear')
clf.fit(X,Y)

print(clf)